package config

import (
	"gitee.com/bjf-fhe/apinx/math"
)

type Crypt struct {
	Key   string `goblet:"key,default_key_for_apinx"`
	Tweak string `goblet:"tweak,1D3E5A7C9B0D2F4H"`
	crypt *math.Crypt
}

func (c *Crypt) Check() error {
	var crypt math.Crypt
	err := crypt.Init(c.Key, c.Tweak)
	if err != nil {
		return err
	}
	c.crypt = &crypt
	return nil
}
